-
-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Export types directly from sqlstring dependency #3047
Conversation
Signed-off-by: Scraps <[email protected]>
Thanks, @ScrapsPrograms 🚀 To use node-mysql2/website/docs/index.mdx Lines 55 to 58 in 3d2327d
For example, you're re-exporting all types from Also, it's important to note that this approach can imply a breaking change for TypeScript users, as they will need to install the What do you think, @ScrapsPrograms? |
This comment was marked as off-topic.
This comment was marked as off-topic.
TLDR; The added
If I understand this correctly, the documentation here asks users to install the type definitions themselves. I would argue that, for a function exported by the node-mysql2 package, it'd make more sense for the typing to be exported alongside it, rather than requiring a separate user installation.
This is true, and I have to admit I overlooked that. I can move them to the dependencies to have the typing included with the node-mysql2 typing definitions.
This is understandable. Looking at the originally exported types and the types exported by To ensure no breaking changes are applied, an overload for the |
I'm not sure about this idea. Type dependencies shouldn't affect JavaScript users, for example by requiring
For now, I think it's better to define the types directly in MySQL2. Let me know your thoughts 🙋🏻♂️ |
This seems to push the Another option is to keep going the way node-mysql2 originally handled this: copy the types and handle it in the types package. For this PR, that'd just be a matter of copying the types exposed in It seems the
This can be covered by replacing the type Lastly, and I'm not much a fan of this reasoning, but it must be mentioned to cover the last option I can come up with at this time, the typing information of Unless a means of properly distributing the |
For version Just a note:
|
This reverts commit f489a97.
Signed-off-by: Scraps <[email protected]>
Signed-off-by: Scraps <[email protected]>
Signed-off-by: Scraps <[email protected]>
Signed-off-by: Scraps <[email protected]>
Signed-off-by: Scraps <[email protected]>
Signed-off-by: Scraps <[email protected]>
Thanks, @ScrapsPrograms 🚀 |
Instead of defining new types, this change exports the
sqlstring
dependency's typing information directly.Originally the idea was to just update the type of
escape
, but looking a bit further, this change seems to make more sense.For reference, see this issue.